SIGN block

Short summary

Name

SIGN

→POU type

→function

Category

IEC-block, NumericEnh

Conform to →IEC-standard

(plus) not defined in IEC-standard

Graphical interface

Available since

version 1.27.0 (for Neuron Power Engineer)

Functionality

The block returns information about the sign of the value that is connected to the input IN:

Value connected to IN

Return value

< 0

-1

0

0

> 0

1

Inputs, return value

 

Identifier

→Data type

Description

Inputs:

IN

REALLREALUSINTUINTUDINTULINTSINTINTDINT or LINT
(corresponds to →generic data type ANY_NUM)

value

Return value:

SINT

 

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

PROGRAM Test
   VAR
      result1, result2, result3 : SINT;
   END_VAR
   result1 := SIGN(INT#-5);    (* The variable 'result1' evaluates to '-1'. *)
   result2 := SIGN(INT#0);     (* The variable 'result2' evaluates to '0'. *)
   result3 := SIGN(INT#5);     (* The variable 'result3' evaluates to '1'. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.